Devinがpdfjs-dist npmの更新でNode.js 20.4以上が必要な事をつきとめ、polyfillを作って解決してくれた
code:error
D readFileText-local-dev au4ngpd29bd9 2025-04-17 21:52:46.662 Function execution started
E readFileText-local-dev m71jta1e8owh 2025-04-17 21:19:00.160 TypeError: Promise.withResolvers is not a function
at new PDFDocumentLoadingTask (file:///workspace/node_modules/pdfjs-dist/build/pdf.mjs:3026:32)
at getDocument (file:///workspace/node_modules/pdfjs-dist/build/pdf.mjs:2838:16)
at readPDFText (file:///workspace/contentType/pdf.js:15:17)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async httpHandler (file:///workspace/index.js:53:20)
D readFileText-local-dev m71jta1e8owh 2025-04-17 21:18:59.096 Function execution took 933 ms, finished with status code: 500
Node20にしたけどまだPromise.withResolvers無いよって言ったら、Devin.iconがPolyfill作ってくれた cloud functionのnode.jsは20を指定しても20.4未満なのかな多分
https://gyazo.com/646d8b914531afc2182a7f4da12ae427
PDFからテキスト取得できるようになった
https://gyazo.com/d2106a770a11a419326d1b3a46a3b37f